﻿<template>
    <div>
        <h2>学校名称:{{name}}</h2>
        <h2>学校地址:{{address}}</h2>
    </div>
</template>

<script>
    export default{
        name: 'School',
        components:{},
        data() {
            return {
                name: 'bilibili',
                address: '魔都'
            }
        },
        mounted() {
            console.log('School',this)
            this.$bus.$on('hello',(data)=>{
                console.log('这里是School组件,收到了数据',data)
            })
        },
        beforeDestroy() {
            this.$bus.$off('hello')
        },
    }
</script>

<style scoped>

</style>